<template>
    <button @click="test">触发hello事件{{msg}}</button>
</template>

<script lang="ts">
    import {defineComponent} from 'vue'
    export default defineComponent({
        emits:['hello'],
        props:['msg'],
        setup(props,context){
            function test(){
                context.emit('hello','haha')
            }
            return {
                test
            }
        }
    })
</script>

<style scoped>

</style>
